// 函数式组件的计数器
import { useState } from 'react'

function CountFC() {
    const [count, setCount] = useState(0)
    const add = () => {
        setCount(count + 1)
    }
    return <div>
        <h2>函数式组件的计数器</h2>
        <p>{count}</p>
        <button onClick={() => add()}>点我+1</button>
    </div>
}

export default CountFC

